﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Hanhud.Web.Modules
{
    public class SiteModule : ISiteModule
    {
        private string _name;
        public string Name
        {
            get { return _name; }
            protected set
            {
                if (string.IsNullOrEmpty(value))
                    throw new InvalidOperationException("Module's name could not be empty");
                if (_name != value)
                {
                    _name = value;
                }
            }
        }

        public SiteModule(string name)
        {
            if (string.IsNullOrEmpty(name)) throw new InvalidOperationException("Module's name could not be empty");

            _name = name;

            // Add to module collection
        }

        public override string ToString()
        {
            return string.Empty;
        }

        public static SiteModule FromString(string name)
        {
            return 
                new SiteModule(name);
        }

        private Dictionary<string, Hanhud.Web.UI.SitePage> _sitePages = new Dictionary<string, UI.SitePage>();
        public Dictionary<string, Hanhud.Web.UI.SitePage> SitePages
        {
            get
            {
                return _sitePages;
            }
        }
    }
}
